function addAdmin() {
    roleList();
    saveAdminBtnaction('add');
}
function saveAdminBtnaction(action) {
    $('#save').click(function () {
        if (!$('#account').val()) return alert('请输入账号');
        if (!$('#name').val()) return alert('请输入姓名');
        if (!$('#password').val()) return alert('请输入密码');
        if (!$('#confirm_password').val()) return alert('请再次输入密码');
        if (!$('#role_id').val()) return alert('请选择角色');
        $.ajax({
            url: http_url + 'Admin/' + action,
            type: 'POST',
            data: {
                token: sessionStorage.token,
                account: $('#account').val(),
                name: $('#name').val(),
                password: $('#password').val(),
                confirm_password: $('#confirm_password').val(),
                role_id: $('#role_id').val()
            },
            success: function (response) {
                if (response.code == 0) {
                    // console.log(data.start_time);
                    // console.log($('#start_time').val());
                    alert('成功');
                }
            }
        });
    });

}

